home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-04-09 | 9.5 KB | 322 lines | [TEXT/MPS ] |
- ;
- ; File: QD3DSet.a
- ;
- ; Contains: Q3Set types and routines
- ;
- ; Version: Technology: Quickdraw 3D 1.5.4
- ; Release: QuickTime 3.0
- ;
- ; Copyright: © 1995-1998 by Apple Computer, Inc., all rights reserved.
- ;
- ; Bugs?: Please include the the file and version information (from above) with
- ; the problem description. Developers belonging to one of the Apple
- ; developer programs can submit bug reports to:
- ;
- ; devsupport@apple.com
- ;
- ;
- IF &TYPE('__QD3DSET__') = 'UNDEFINED' THEN
- __QD3DSET__ SET 1
-
- IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
- include 'QD3D.a'
- ENDIF
-
- ; ******************************************************************************
- ; ** **
- ; ** Set Routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3SetObject Q3Set_New(void )
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Set_New
- ENDIF
-
- ;
- ; extern TQ3ObjectType Q3Set_GetType(TQ3SetObject theSet)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Set_GetType
- ENDIF
-
- ;
- ; extern TQ3Status Q3Set_Add(TQ3SetObject theSet, TQ3ElementType theType, const void *data)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Set_Add
- ENDIF
-
- ;
- ; extern TQ3Status Q3Set_Get(TQ3SetObject theSet, TQ3ElementType theType, void *data)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Set_Get
- ENDIF
-
- ;
- ; extern TQ3Boolean Q3Set_Contains(TQ3SetObject theSet, TQ3ElementType theType)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Set_Contains
- ENDIF
-
- ;
- ; extern TQ3Status Q3Set_Clear(TQ3SetObject theSet, TQ3ElementType theType)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Set_Clear
- ENDIF
-
- ;
- ; extern TQ3Status Q3Set_Empty(TQ3SetObject target)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Set_Empty
- ENDIF
-
- ;
- ; * Iterating through all elements in a set
- ; *
- ; * Pass in kQ3ElementTypeNone to get first type
- ; * kQ3ElementTypeNone is returned when end of list is reached
- ;
-
- ;
- ; extern TQ3Status Q3Set_GetNextElementType(TQ3SetObject theSet, TQ3ElementType *theType)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Set_GetNextElementType
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** Attribute Types **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; * For the data types listed below, pass in a pointer to it in the _Add
- ; * and _Get calls.
- ; *
- ; * For surface shader attributes, reference counts are incremented on
- ; * the _Add and _Get
- ;
-
-
- ; typedef long TQ3AttributeTypes
- ; Data Type
- kQ3AttributeTypeNone EQU 0 ; ---------
- kQ3AttributeTypeSurfaceUV EQU 1 ; TQ3Param2D
- kQ3AttributeTypeShadingUV EQU 2 ; TQ3Param2D
- kQ3AttributeTypeNormal EQU 3 ; TQ3Vector3D
- kQ3AttributeTypeAmbientCoefficient EQU 4 ; float
- kQ3AttributeTypeDiffuseColor EQU 5 ; TQ3ColorRGB
- kQ3AttributeTypeSpecularColor EQU 6 ; TQ3ColorRGB
- kQ3AttributeTypeSpecularControl EQU 7 ; float
- kQ3AttributeTypeTransparencyColor EQU 8 ; TQ3ColorRGB
- kQ3AttributeTypeSurfaceTangent EQU 9 ; TQ3Tangent2D
- kQ3AttributeTypeHighlightState EQU 10 ; TQ3Switch
- kQ3AttributeTypeSurfaceShader EQU 11 ; TQ3SurfaceShaderObject
- kQ3AttributeTypeNumTypes EQU 12
- ; typedef TQ3ElementType TQ3AttributeType
-
- ; ******************************************************************************
- ; ** **
- ; ** Attribute Drawing **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Status Q3Attribute_Submit(TQ3AttributeType attributeType, const void *data, TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Attribute_Submit
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** AttributeSet Routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3AttributeSet Q3AttributeSet_New(void )
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3AttributeSet_New
- ENDIF
-
- ;
- ; extern TQ3Status Q3AttributeSet_Add(TQ3AttributeSet attributeSet, TQ3AttributeType theType, const void *data)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3AttributeSet_Add
- ENDIF
-
- ;
- ; extern TQ3Boolean Q3AttributeSet_Contains(TQ3AttributeSet attributeSet, TQ3AttributeType attributeType)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3AttributeSet_Contains
- ENDIF
-
- ;
- ; extern TQ3Status Q3AttributeSet_Get(TQ3AttributeSet attributeSet, TQ3AttributeType theType, void *data)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3AttributeSet_Get
- ENDIF
-
- ;
- ; extern TQ3Status Q3AttributeSet_Clear(TQ3AttributeSet attributeSet, TQ3AttributeType theType)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3AttributeSet_Clear
- ENDIF
-
- ;
- ; extern TQ3Status Q3AttributeSet_Empty(TQ3AttributeSet target)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3AttributeSet_Empty
- ENDIF
-
- ;
- ; * Q3AttributeSet_GetNextAttributeType
- ; *
- ; * Pass in kQ3AttributeTypeNone to get first type
- ; * kQ3AttributeTypeNone is returned when end of list is reached
- ;
-
- ;
- ; extern TQ3Status Q3AttributeSet_GetNextAttributeType(TQ3AttributeSet source, TQ3AttributeType *theType)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3AttributeSet_GetNextAttributeType
- ENDIF
-
- ;
- ; extern TQ3Status Q3AttributeSet_Submit(TQ3AttributeSet attributeSet, TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3AttributeSet_Submit
- ENDIF
-
- ;
- ; * Inherit from parent->child into result
- ; * Result attributes are:
- ; * all child attributes + all parent attributes NOT in the child
- ;
-
- ;
- ; extern TQ3Status Q3AttributeSet_Inherit(TQ3AttributeSet parent, TQ3AttributeSet child, TQ3AttributeSet result)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3AttributeSet_Inherit
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** Custom Element Registration **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; * Element Methods -
- ; *
- ; * When you create a custom element, you control what structures are
- ; * passed around the API. For example, you may allow the Q3Set_Add call
- ; * take one type of argument, store your element internally in some
- ; * abstract data type, and have the Q3Set_Get call take a different
- ; * argument.
- ; *
- ; * For example:
- ; *
- ; * There are four calls which at some point will copy an element:
- ; *
- ; * Q3Set_Add (copied from Application memory to QuickDraw3D memory)
- ; * Q3Set_Get (copied from QuickDraw3D memory to Application memory)
- ; * Q3Object_Duplicate (all elements are copied internally)
- ; * Q3AttributeSet_Inherit (all elements are copied internally)
- ; *
- ; * Either CopyAdd or CopyReplace is called during the "_Add" call.
- ; * - CopyAdd is destructive and should assume "toElement" is garbage
- ; * - CopyReplace is replacing an existing element.
- ; *
- ; * CopyGet is called during the "_Get" call.
- ; *
- ; * CopyDuplicate is called to duplicate an element's internal structure.
- ; *
- ; * Attributes Methods -
- ; *
- ; * For copying data while Inheriting. Element methods are used
- ; * at all other times.
- ; *
- ; * CopyInherit is called to duplicate an element's internal structure
- ; * during inheritance. You should make this as fast as possible.
- ; * (for example, if your custom element contains objects, you
- ; * should do a Q3Shared_GetReference instead of a Q3Object_Duplicate)
- ; *
- ; * The ElementDelete method will be called for all of your elements
- ; * copied around via CopyAdd, CopyReplace, CopyDuplicate, and
- ; * CopyInherit.
- ; * If CopyGet allocates any memory in it's destination, it is up to the
- ; * application to delete it on its side.
- ;
-
-
- kQ3XMethodTypeElementCopyAdd EQU 'ecpa'
- kQ3XMethodTypeElementCopyReplace EQU 'ecpr'
- kQ3XMethodTypeElementCopyGet EQU 'ecpg'
- kQ3XMethodTypeElementCopyDuplicate EQU 'eccd'
- kQ3XMethodTypeElementDelete EQU 'ecpl'
- ;
- ; extern TQ3XObjectClass Q3XElementClass_Register(TQ3ElementType *elementType, const char *name, unsigned long sizeOfElement, TQ3XMetaHandler metaHandler)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3XElementClass_Register
- ENDIF
-
- ;
- ; extern TQ3Status Q3XElementType_GetElementSize(TQ3ElementType elementType, unsigned long *sizeOfElement)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3XElementType_GetElementSize
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** Custom Attribute Registration **
- ; ** **
- ; ****************************************************************************
-
- ; typedef TQ3Boolean TQ3XAttributeInheritMethod
-
- ; return kQ3True or kQ3False in your metahandler
- ;
- ; extern TQ3XObjectClass Q3XAttributeClass_Register(TQ3AttributeType *attributeType, const char *creatorName, unsigned long sizeOfElement, TQ3XMetaHandler metaHandler)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3XAttributeClass_Register
- ENDIF
-
- ;
- ; * Version 1.5
- ;
-
-
-
-
-
-
-
- ENDIF ; __QD3DSET__
-
-